﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;

namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class FTradeInvoiceAdd : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "FTradeReceivablesListEasyUI";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.应收帐款_发票 };
            }
        }

        protected int FTradeID
        {
            get
            {

                return GetRequestValue<int>("FTradeID", 0);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();

            }
        }
        private void addmenu()
        {
            FTradeInvoiceInfo obj = Request.SerializableObject<FTradeInvoiceInfo>();
            obj.RealName = base.User.RealName;

            int msg = FTradeInvoiceController.Add(obj);

            AddLog(Permission.新增, obj);

            if (msg > 0)
                SuccessJson("新增成功", "FTradeInvoiceList");
            else
            {

                ErrorJson("新增失败");
            }
        }
    }
}